package com.yjd.bi.rewards.service.impl;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;
import org.springframework.stereotype.Service;

import com.yjd.comm.base.dao.IBaseDao;
import com.yjd.comm.base.service.impl.BaseServiceImpl;
import com.yjd.bi.rewards.model.FundsFinancialDataModel;
import com.yjd.bi.rewards.service.IFundsFinancialDataService;
import com.yjd.bi.rewards.dao.IFundsFinancialDataDao;

/**
 * <b>description</b>：理财金使用流水业务实现<br>
 * <b>time</b>：2016-08-17 16:12:14 <br>
 * <b>author</b>：  renbangjie renbangjie@126.com
 */
@Service("fundsFinancialDataService")
public class FundsFinancialDataServiceImpl extends BaseServiceImpl implements IFundsFinancialDataService {

	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public FundsFinancialDataModel insert(FundsFinancialDataModel model) throws Exception {
		return this.fundsFinancialDataDao.insertModel(model, true);
	}

	/**
	 * 更新
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(FundsFinancialDataModel model) throws Exception {
		return this.fundsFinancialDataDao.updateModel(model, true);
	}

	/**
	 * 根据id删除
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int delete(long id) throws Exception {
		Map<Object, Object> paramMap = new HashMap<Object, Object>();
		paramMap.put("id", id);
		return this.fundsFinancialDataDao.deleteModel(paramMap, true);
	}
	
	
	@Override
	public Double getTotalReturnAmount(Map<String, Object> paramMap) {
		return fundsFinancialDataDao.getTotalReturnAmount(paramMap);
	}
	

	@Resource
	private IFundsFinancialDataDao fundsFinancialDataDao;

	@Override
	public IBaseDao getBaseDao() {
		return this.fundsFinancialDataDao;
	}

}
